package com.fare.taluo.core.domain.analyse.report;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.dayatang.domain.InstanceFactory;
import com.fare.taluo.fetl.domain.base.BaseFetlEntity;
@Entity
@Table(name = "csair_taobao")
public class CsairTaobaoEntity extends BaseFetlEntity
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 2039496823738451397L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	/**
	 * 报表日期 2014-01-01
	 */
	@Column(name = "REPORT_DATE")
	private Date reportDate;

	/**
	 * 航班日期 2014-01-01
	 */
	@Column(name = "FLIGHT_DATE")
	private Date flightDate;

	/**
	 * 出发城市三字码
	 */
	@Column(name = "FROM_CITY")
	private String fromCity;

	/**
	 * 出发城市名称
	 */
	@Column(name = "FROM_CITY_NAME")
	private String fromCityName;

	/**
	 * 到达城市三字码
	 */
	@Column(name = "TO_CITY")
	private String toCity;

	/**
	 * 到达城市名称
	 */
	@Column(name = "TO_CITY_NAME")
	private String toCityName;

	/**
	 * 航班号
	 */
	@Column(name = "FLIGHT_NO")
	private String flightNo;

	/**
	 * 创建时间
	 */
	@Column(name = "CREATE_TIME")
	private Date creattime;

	/**
	 * 官网rowkey
	 */
	@Column(name = "HBASE_KEY")
	private String hbaseKey;

	/**
	 * 渠道rowkey
	 */
	@Column(name = "CHANNEL_KEY")
	private String channelKey;

	/**
	 * 官网价格
	 */
	@Column(name = "PRICE")
	private Double price;

	/**
	 * 渠道价格
	 */
	@Column(name = "CHANNEL_PRICE")
	private Double channelPrice;

	/**
	 * 价差金额 官网-渠道
	 */
	@Column(name = "SPREAD_AMOUNT")
	private Double spreadAmount;

	/**
	 * 价差比=（官网-渠道）/官网
	 */
	@Column(name = "SPREAD")
	private Double spread;

	// 渠道名称
	@Column(name = "CHANNEL_NAME")
	private String channelName;

	// 代理名称
	@Column(name = "AGENT_NAME")
	private String agentName;

	private static CsairTaobaoEntityRepository csairTaobaoEntityRepository;

	public List<CsairTaobaoEntity> findByCondition(String fromCity,
			String toCity, String flightNo, String flightDate,String reportDate) {
		return getCsairTaobaoEntityRepository().findByCondition(fromCity,
				toCity, flightNo, flightDate, reportDate);
	}

	public static CsairTaobaoEntityRepository getCsairTaobaoEntityRepository() {
		if (csairTaobaoEntityRepository == null) {
			csairTaobaoEntityRepository = InstanceFactory
					.getInstance(CsairTaobaoEntityRepository.class);
		}
		return csairTaobaoEntityRepository;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getReportDate() {
		return reportDate;
	}

	public void setReportDate(Date reportDate) {
		this.reportDate = reportDate;
	}

	public Date getFlightDate() {
		return flightDate;
	}

	public void setFlightDate(Date flightDate) {
		this.flightDate = flightDate;
	}

	public String getFromCity() {
		return fromCity;
	}

	public void setFromCity(String fromCity) {
		this.fromCity = fromCity;
	}

	public String getFromCityName() {
		return fromCityName;
	}

	public void setFromCityName(String fromCityName) {
		this.fromCityName = fromCityName;
	}

	public String getToCity() {
		return toCity;
	}

	public void setToCity(String toCity) {
		this.toCity = toCity;
	}

	public String getToCityName() {
		return toCityName;
	}

	public void setToCityName(String toCityName) {
		this.toCityName = toCityName;
	}

	public String getFlightNo() {
		return flightNo;
	}

	public void setFlightNo(String flightNo) {
		this.flightNo = flightNo;
	}

	public Date getCreattime() {
		return creattime;
	}

	public void setCreattime(Date creattime) {
		this.creattime = creattime;
	}

	public String getHbaseKey() {
		return hbaseKey;
	}

	public void setHbaseKey(String hbaseKey) {
		this.hbaseKey = hbaseKey;
	}

	public String getChannelKey() {
		return channelKey;
	}

	public void setChannelKey(String channelKey) {
		this.channelKey = channelKey;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Double getChannelPrice() {
		return channelPrice;
	}

	public void setChannelPrice(Double channelPrice) {
		this.channelPrice = channelPrice;
	}

	public Double getSpreadAmount() {
		return spreadAmount;
	}

	public void setSpreadAmount(Double spreadAmount) {
		this.spreadAmount = spreadAmount;
	}

	public Double getSpread() {
		return spread;
	}

	public void setSpread(Double spread) {
		this.spread = spread;
	}


	public String getChannelName() {
		return channelName;
	}

	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}

	public String getAgentName() {
		return agentName;
	}

	public void setAgentName(String agentName) {
		this.agentName = agentName;
	}

	@Override
	public boolean isNew() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean existed() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean notExisted() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean existed(String propertyName, Object propertyValue) {
		// TODO Auto-generated method stub
		return false;
	}
}
